package com.dianjing.dianqun;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 暂时不开启缓存功能 缓存需要看业务需要
 * 
 * @author djn104
 *
 */
@ServletComponentScan
@EnableTransactionManagement
@SpringBootApplication
@MapperScan(basePackages = { "com.dianjing.dianqun.dao" })
// @EnableCaching
public class DianqunApplication {

	public static void main(String[] args) {
		SpringApplication.run(DianqunApplication.class, args);
	}

	/*@Bean
	public EmbeddedServletContainerCustomizer containerCustomizer() {
		return new EmbeddedServletContainerCustomizer() {

			@Override
			public void customize(ConfigurableEmbeddedServletContainer container) {
				ErrorPage error403Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "errorunauthorized");
				ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "errornotFound");
				ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "errorserverError");
				container.addErrorPages(error403Page, error404Page, error500Page);
			}
		};
	}*/

	// jwt的过滤器注册
	/*@Bean
	public FilterRegistrationBean filterRegistrationBean() {
		FilterRegistrationBean registrationBean = new FilterRegistrationBean();
		JwtFilter httpBasicFilter = new JwtFilter();
		registrationBean.setFilter(httpBasicFilter);
		List<String> urlPatterns = new ArrayList<String>();
		urlPatterns.add("api");
		registrationBean.setUrlPatterns(urlPatterns);
		return registrationBean;
	}*/

}
